package com.zb.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zb.entity.ZjNetworkTeamAuthenFieldValOption;
import com.zb.mapper.ZjNetworkTeamAuthenFieldValOptionMapper;
import com.zb.service.ZjNetworkTeamAuthenFieldValOptionService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 网点团队认证字段值内容表 服务实现类
 * </p>
 *
 * @author WEN
 * @since 2024-02-01
 */
@Service
public class ZjNetworkTeamAuthenFieldValOptionServiceImpl extends ServiceImpl<ZjNetworkTeamAuthenFieldValOptionMapper, ZjNetworkTeamAuthenFieldValOption> implements ZjNetworkTeamAuthenFieldValOptionService {

    // 根据服务商ID获取字段内容
    @Override
    public List<ZjNetworkTeamAuthenFieldValOption> getByNetworkId(Long networkId) {
        QueryWrapper<ZjNetworkTeamAuthenFieldValOption> wrapper = new QueryWrapper<>();
        wrapper.select("network_team_authen_field_val_id", "opt_value")
                .eq("network_id", networkId);
        return this.list(wrapper);
    }

    // 根据服务商ID删除字段内容
    @Override
    public void deleteByNetworkId(Long networkId) {
        QueryWrapper<ZjNetworkTeamAuthenFieldValOption> wrapper = new QueryWrapper<>();
        wrapper.eq("network_id", networkId);
        this.remove(wrapper);
    }
}
